package com.region.integral.util;

import java.text.MessageFormat;
import java.util.Date;

import com.region.integral.business_user.pojo.BusinessLogEntity;

public class BusinessUserLogUtil {
	static {
		PropertiesLogerUtil.load(BusinessUserLogUtil.class.getResourceAsStream("/"+LoadResourcesUtil.getResource(IntegralConstants.BUSINESS_USER_LOG)));
	}
	public static BusinessLogEntity log(int userid,int integral,String event){
		String describe = MessageFormat.format(PropertiesLogerUtil.getRuleIntegral(event), userid,event,integral);
		BusinessLogEntity clenEntity = new BusinessLogEntity();
		clenEntity.setUserid(userid);
		clenEntity.setRecordDate(new Date());
		clenEntity.setEvent(event);
		clenEntity.setDescribe(describe);
		return clenEntity;
	}
}
